#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N = 2e5 + 10;
const int mod =1e9+7;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
int n;
int main()
{
	close();
	vector<ll> a, b;
	cin >> n;
	for (int i = 1; i <= n; i += 2)
	{
		a.push_back(i);
		b.push_back(i);
	}
	for (int i = (n & 1 ? n - 1 : n); i >= 1; i -= 2)
	{
		a.push_back(i);
		b.push_back(i);
	}

	ll ans = 0;
	while (a.size() != 1)
	{
		vector<ll> t;
		for (int i = 0; i < a.size()-1; i++)
		{
			ll ans = (a[i] + a[i + 1]) % mod;
			t.push_back(ans);
		}
		a=t;
	}
	cout << a[0] << '\n';
	for (int i = 0; i < b.size(); i++)
	{
		cout << b[i] << " ";
	}
	cout << '\n';

	return 0;
}